package com.headfirst.CreateMode.factory.abstractfactory.pizza;

import com.headfirst.CreateMode.factory.abstractfactory.ingredientfactory.PizzaIngredientFactory;

public class PepperoniPizza extends Pizza{
    private PizzaIngredientFactory ingredientFactory;

    public PepperoniPizza(PizzaIngredientFactory ingredientFactory) {
        this.ingredientFactory = ingredientFactory;
    }

    @Override
    public void prepare() {
        System.out.println("Preparing "+super.getName());
        super.setDough(ingredientFactory.createDough());
        super.setSauce(ingredientFactory.createSauce());
        super.setCheese(ingredientFactory.createCheese());
        super.setClam(ingredientFactory.createClam());
        super.setPepperoni(ingredientFactory.createPepperoni());
    }
}
